//
//  API.h
//  OAProject
//
//  Created by yhj on 2017/2/21.
//  Copyright © 2017年 cdnunion. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface API : NSObject

//  用户登录
+(void)loginWithUserName:(NSString *)userName password:(NSString *)password success:(void(^)(id res))success failure:(void(^)(NSInteger stateCode))failure;

//  注销
+(void)logoutWithSuccess:(void(^)(BOOL is_logout))success failure:(void(^)(NSInteger stateCode))failure;



//  添加项目
+(void)AddProjectWithProjectName:(NSString *)projectName description:(NSString *)description success:(void(^)(id res))success failure:(void(^)(NSInteger stateCode))failure;

//  项目信息修改
+(void)EditProjectWithProjectID:(NSString *)projectID description:(NSString *)description success:(void(^)(id res))success failure:(void(^)(NSInteger stateCode))failure;

//  删除项目
+(void)DeleteProjectWithProjectID:(NSString *)projectID success:(void(^)(id res))success failure:(void(^)(NSInteger stateCode))failure;

// 获取项目列表
+(void)GetProjectListWithPer_page:(NSString *)per_page page_num:(NSString *)page_num success:(void(^)(id res))success failure:(void(^)(NSInteger stateCode))failure;




// 添加目标归类
+(void)AddSortWithSortName:(NSString *)sortName memo:(NSString *)memo success:(void(^)(id res))success failure:(void(^)(NSInteger stateCode))failure;

// 修改目标归类
+(void)EdidSortWithSortID:(NSString *)sortID sortName:(NSString *)sortName memo:(NSString *)memo success:(void(^)(id res))success failure:(void(^)(NSInteger stateCode))failure;


// 删除目标归类
+(void)DeleteSortWithSortID:(NSString *)sortID success:(void(^)(id res))success failure:(void(^)(NSInteger stateCode))failure;

// 获取目标归类列表
+(void)GetSortListWithPer_page:(NSString *)per_page page_num:(NSString *)page_num success:(void(^)(id res))success failure:(void(^)(NSInteger stateCode))failure;




// 添加用户
+(void)AddUserWithName:(NSString *)name phone:(NSString *)phone memberID:(NSString *)memberID email:(NSString *)email passwd:(NSString *)passwd success:(void(^)(id res))success failure:(void(^)(NSInteger stateCode))failure;

// 获取所有的用户列表
+(void)GetAllUserListWithPer_page:(NSString *)per_page page_num:(NSString *)page_num success:(void(^)(id res))success failure:(void(^)(NSInteger stateCode))failure;

// 获取部门
+(void)GetGroupListWithGroupID:(NSString *)groupID success:(void(^)(id res))success failure:(void(^)(NSInteger stateCode))failure;

// 获取下级部门及其用户列表
+(void)GetGroupDetailListWithGroupID:(NSString *)groupID return_type:(NSString *)return_type success:(void(^)(id res))success failure:(void(^)(NSInteger stateCode))failure;




// 获取优先级
+(void)GetPriorityListSuccess:(void(^)(id res))success failure:(void(^)(NSInteger stateCode))failure;

// 获取流程列表
+(void)GetTaskProgressListWithTaskID:(NSString *)taskID  success:(void(^)(id res))success failure:(void(^)(NSInteger stateCode))failure;

// 获取流程状态列表
+(void)GetTaskProgressStatusListSuccess:(void(^)(id res))success failure:(void(^)(NSInteger stateCode))failure;

// 获取流程详情
+(void)GetTaskProgressDetailWithStepID:(NSString *)stepID success:(void(^)(id res))success failure:(void(^)(NSInteger stateCode))failure;

// 添加任务
+(void)AddTaskSuccess:(void(^)(id res))success failure:(void(^)(NSInteger stateCode))failure;

// 取消任务
+(void)CancelTaskWithTaskID:(NSString *)taskID success:(void(^)(id res))success failure:(void(^)(NSInteger stateCode))failure;

// 获取任务状态列表
+(void)GetTaskStatusListSuccess:(void(^)(id res))success failure:(void(^)(NSInteger stateCode))failure;

// 获取任务日志列表
+(void)GetTaskLogListWithTaskID:(NSString *)taskID stepID:(NSString *)stepID per_page:(NSString *)per_page page_num:(NSString *)page_num success:(void(^)(id res))success failure:(void(^)(NSInteger stateCode))failure;


// 获取任务详情
+(void)GetTaskDetailWithTaskID:(NSString *)taskID success:(void(^)(id res))success failure:(void(^)(NSInteger stateCode))failure;

// 任务状态更新
+(void)UpdateTaskStatusWithTaskID:(NSString *)taskID tempo:(NSString *)tempo log:(NSString *)log attachments:(NSString *)attachments success:(void(^)(id res))success failure:(void(^)(NSInteger stateCode))failure;

// 执行人流程处理
+(void)DealTaskWithTaskID:(NSString *)taskID ac:(NSString *)ac turnID:(NSString *)turnID  memo:(NSString *)memo success:(void(^)(id res))success failure:(void(^)(NSInteger stateCode))failure;

// 获取任务列表
+(void)GetTaskListWithProjectID:(NSString *)projectID createrID:(NSString *)createrID userID:(NSString *)userID  targetType:(NSString *)targetType priority:(NSString *)priority status:(NSString *)status stepStatus:(NSString *)stepStatus per_page:(NSString *)per_page page_num:(NSString *)page_num success:(void(^)(id res))success failure:(void(^)(NSInteger stateCode))failure;

// 添加流程
+(void)AddTaskProgressWithTaskID:(NSString *)taskID title:(NSString *)title user_ids:(NSArray *)user_ids estimateEtime:(NSString *)estimateEtime fatherID:(NSString *)fatherID remindMin:(NSString *)remindMin description:(NSString *)description attachments:(NSString *)attachments success:(void(^)(id res))success failure:(void(^)(NSInteger stateCode))failure;

// 修改流程
+(void)EditTaskProgressWithStepID:(NSString *)stepID title:(NSString *)title userIDs:(NSMutableArray *)userIDs estimateEtime:(NSString *)estimateEtime fatherID:(NSString *)fatherID remindMin:(NSString *)remindMin description:(NSString *)description attachments:(NSString *)attachments success:(void(^)(id res))success failure:(void(^)(NSInteger stateCode))failure;


// 删除流程
+(void)DeleteTaskProgressWithStepID:(NSString *)stepID success:(void(^)(id res))success failure:(void(^)(NSInteger stateCode))failure;

// 发布任务
+(void)PublicTaskWithTaskID:(NSString *)taskID projectID:(NSString *)projectID title:(NSString *)title target_types:(NSArray *)target_types priority:(NSString *)priority estimate_stime:(NSString *)estimate_stime target_desc:(NSString *)target_desc exec_method:(NSString *)exec_method memo:(NSString *)memo attachments:(NSMutableDictionary *)attachments success:(void(^)(id res))success failure:(void(^)(NSInteger stateCode))failure;


// 修改任务
+(void)EditTaskWithTaskID:(NSString *)taskID projectID:(NSString *)projectID title:(NSString *)title target_types:(NSArray *)target_types priority:(NSString *)priority estimate_stime:(NSString *)estimate_stime target_desc:(NSString *)target_desc exec_method:(NSString *)exec_method memo:(NSString *)memo attachments:(NSMutableDictionary *)attachments success:(void(^)(id res))success failure:(void(^)(NSInteger stateCode))failure;

// 任务验收
+(void)CheckTaskID:(NSString *)taskID ac:(NSString *)ac turn_id:(NSString *)turn_id memo:(NSString *)memo success:(void(^)(id res))success failure:(void(^)(NSInteger stateCode))failure;

// 任务评分
+(void)EvaluateTaskWithTaskID:(NSString *)taskID quality:(NSString *)quality efficient:(NSString *)efficient attitude:(NSString *)attitude memo:(NSString *)memo step_evaluate:(NSArray *)step_evaluate success:(void(^)(id res))success failure:(void(^)(NSInteger stateCode))failure;

// 获取评价信息
+(void)GetTaskEvaluateInfoRefID:(NSString *)refID ref:(NSString *)ref success:(void(^)(id res))success failure:(void(^)(NSInteger stateCode))failure;


// 更新app
+(void)updateAppWithMyIDCode:(NSString *)myIDCode token:(NSString *)token success:(void(^)(id res))success failure:(void(^)(NSInteger stateCode))failure;

// 获取任务日志数据
+(void)GetTaskLogDetailWithLogID:(NSString *)logID success:(void(^)(id res))success failure:(void(^)(NSInteger stateCode))failure;

@end
